package com.miao.controller;

import com.miao.dao.UserDao;
import com.miao.entity.User;
import com.miao.vo.ResultVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author: 丰
 * @date: 2023/3/1 13:49
 */

@RestController
@Api(tags = "测试接口")
public class TestController {
    @Autowired
    private UserDao userDao;

    @GetMapping("/test")
    @ApiOperation("hello")
    public ResultVo<String> test() {
        return ResultVo.success("hello");
    }

    @GetMapping("/getById/{id}")
    @ApiOperation("查询用户")
    public ResultVo<User> testss(@PathVariable("id") Integer id) {
        User user = userDao.selectById(id);
        return ResultVo.success(user);
    }
}








